/*
 * @Description: 路由表
 {
        path: '',  必须为完全路径
        name: '',
        component:()=>import(),
        meta: { 
          title: '', 菜单标题
          keepAlive: true, 是否缓存该组件
          icon:'' ,  菜单图表，图标必须在assets/icons/index文件中使用内联导出，在此文件内导入
          hidden:false,  是否隐藏该菜单项
          permission:[]  权限数组，该菜单需要哪些权限才可以访问
        },
      },
 * @Autor: 人生
 * @Date: 2020-09-27 15:37:53
 * @,@LastEditors: ,: 人生
 */

import RouteView from '../components/RouteView.vue'
export const asyncRouterMap = [
  {
    path: '*',
    name: 'index',
    component: ()=>import(/*webpackChunkName:'ProLayout'*/ '@/components/proLayout.vue'),
    children:[
      {
        path:'/account',
        name:'account',
        redirect: '/account/averageUser',
        // component:RouteView,
        meta: { title: '用户管理',icon:'fire',permission:['用户管理','注册用户','管理用户'] },
        children:[
          {
            path: '/account/averageUser',
            name: 'account.averageUser',
            // component:()=>import(/*webpackChunkName:'account.averageUser'*/'@/views/account/averageUser'),
            meta: { title: '注册用户',permission:['注册用户'] },
          },
          {
            path: '/account/averageUser/audit',
            name: 'account.averageUser.audit',
            // component:()=>import(/*webpackChunkName:'account.averageUser.audit'*/'@/views/account/averageUser/audit.vue'),
            meta: { title: '审核', hidden:true,permission:['注册用户'] },
          },
          {
            path: '/account/manageUser',
            name: 'account.manageUser',
            // component:()=>import(/*webpackChunkName:'account.manageUser'*/'@/views/account/manageUser'),
            meta: { title: '管理用户',permission:['管理用户'] },
          }
        ]
      },
      {
        path:'/Law',
        name:'Law',
        redirect: '/Law/index',
        component:RouteView,
        meta: { title: '执法管理',icon:'fire',permission:['执法管理','法律法规查阅'] },
        children:[
          {
            path: '/Law/index',
            name: 'Law.index',
            component:()=>import(/*webpackChunkName:'Law.index'*/'@/views/Law'),
            meta: { title: '法律法规查阅',permission:['法律法规查阅'] },
          },
        ]
      },
      {
        path:'/advice',
        name:'advice',
        component:()=>import(/*webpackChunkName:'advice'*/'@/views/advice'),
        meta: { title: '建议管理',icon:'fire',permission:['建议管理']  },
      },
      {
        path:'/setting',
        name:'setting',
        redirect: '/setting/notice',
        // component:RouteView,
        meta: { title: '配置管理',icon:'fire', permission:['配置管理','通知公告','政策文件','新闻动态','代理机构','培训通知','培训课件','培训视频','法律法规','管理用户权限']},
        children:[
          {
            path: '/setting/notice',
            name: 'setting.notice',
            // component:()=>import(/*webpackChunkName:'setting.notice'*/'@/views/setting/notice.vue'),
            meta: { title: '通知公告',permission:['通知公告'] },
          },
          {
            path: '/setting/policy',
            name: 'setting.policy',
            // component:()=>import(/*webpackChunkName:'setting.policy'*/'@/views/setting/policy.vue'),
            meta: { title: '政策文件',permission:['政策文件'] },
          },
          {
            path: '/setting/news',
            name: 'setting.news',
            // component:()=>import(/*webpackChunkName:'setting.news'*/'@/views/setting/news.vue'),
            meta: { title: '新闻动态',permission:['新闻动态'] },
          },
          {
            path: '/setting/agency',
            name: 'setting.agency',
            // component:()=>import(/*webpackChunkName:'setting.agency'*/'@/views/setting/agency.vue'),
            meta: { title: '代理机构',permission:['代理机构'] },
          },
          {
            path: '/setting/trainingNotice',
            name: 'setting.trainingNotice',
            // component:()=>import(/*webpackChunkName:'setting.trainingNotice'*/'@/views/setting/trainingNotice.vue'),
            meta: { title: '培训通知',permission:['培训通知'] },
          },
          {
            path: '/setting/trainingCourseware',
            name: 'setting.trainingCourseware',
            // component:()=>import(/*webpackChunkName:'setting.trainingCourseware'*/'@/views/setting/trainingCourseware.vue'),
            meta: { title: '培训课件' ,permission:['培训课件']},
          },
          {
            path: '/setting/trainingVideo',
            name: 'setting.trainingVideo',
            // component:()=>import(/*webpackChunkName:'setting.trainingVideo'*/'@/views/setting/trainingVideo.vue'),
            meta: { title: '培训视频',permission:['培训视频'] },
          },
          {
            path: '/setting/laws',
            name: 'setting.laws',
            // component:()=>import(/*webpackChunkName:'setting.laws'*/'@/views/setting/laws.vue'),
            meta: { title: '法律法规',permission:['法律法规'] },
          },
          {
            path: '/setting/permission',
            name: 'setting.permission',
            // component:()=>import(/*webpackChunkName:'setting.permission'*/'@/views/setting/permission.vue'),
            meta: { title: '管理用户权限',permission:['管理用户权限'] },
            children:[
              {
                path: '/setting/permission/modify',
                name: 'setting.permission.modify',
                // component:()=>import(/*webpackChunkName:'setting.laws'*/'@/views/setting/modifyPermission.vue'),
                meta: { title:'修改权限',hidden:true ,permission:['管理用户权限']},
              },
            ]
          },
        ]
      },
    ],
  },
  // { // 这个* 会被处理到当前所有路由的最后面，与位置无关
  //   path: '*',
  //   component: () => import( /*webpackChunkName:'404'*/ '@/views/404.vue')
  // }, 
]